package com.niit.agricstore.rabbitmq.simple;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
@EnableScheduling //定时任务实现
public class ScheduleHandler {

    @Autowired
    private RabbitTemplate rabbitTemplate;

//    @Scheduled(fixedRate = 6000)
//    private void simpleQueueScheduled(){
//        System.out.println("<<<<<<<<<<<");
//        rabbitTemplate.convertAndSend("simple-queue-1","hello,rabbit!");
//    }

}
